﻿using System.Collections.Generic;
using Client.Commands;
using Contracts.Entities;

namespace Client.ViewModels
{
    public class MovieDetailsEditViewModel : WorkspaceViewModel
    {
        private MovieItem movieItem;

        public MovieDetailsEditViewModel()
        {
            IsEditMode = true;
            LoadImageFromFileCommand = new LoadImageFromFileCommand();
            AddActorCommand = new AddActorCommand();
            RemoveActorCommand = new RemoveActorCommand();
        }

        public LoadImageFromFileCommand LoadImageFromFileCommand { get; set; }

        public AddActorCommand AddActorCommand { get; private set; }

        public RemoveActorCommand RemoveActorCommand { get; private set; }

        /// <summary>
        /// Für AutoComplete Box
        /// </summary>
        public IEnumerable<MovieElement> Actors
        {
            get
            {
                return ActorsViewModel.Default.Items;
            }
        }

        public override MovieItem MovieItem
        {
            get
            {
                return movieItem;
            }
            set
            {
                movieItem = value;
                NotifyPropertyChanged("MovieItem");
            }
        }
    }
}
